package com.km;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class KkrotAMallChatApplication {

    public static void main(String[] args) {
        SpringApplication.run(KkrotAMallChatApplication.class, args);
    }

    // region 转移到netty中打印
//    @Autowired
//    private Environment env;
//
//    @Bean
//    public CommandLineRunner commandLineRunner() {
//        return (args) -> {
//            // 获取CPU核心数
//            int availableProcessors = Runtime.getRuntime().availableProcessors();
//            StaticLog.info("CPU核心数: " + availableProcessors);
//            // 获取JVM当前活动线程数
//            int activeThreads = Thread.activeCount();
//            StaticLog.info("当前活动线程数: " + activeThreads);
//            //本地主机的地址
//            InetAddress inetAddress = InetAddress.getLocalHost();
//            // 你也可以通过env获取其他配置信息
//            //String someConfig = env.getProperty("some.config.key", "默认值");
//            //System.out.println("配置信息: " + someConfig);
//            //log.info(AnsiOutput.toString(AnsiColor.BRIGHT_GREEN, StrUtil.format("项目名称spring.application.name:{}", env.getProperty("spring.application.name"))));
//            //log.info(AnsiOutput.toString(AnsiColor.BRIGHT_GREEN, StrUtil.format("项目请求地址:{}:{}",inetAddress.getHostAddress(),env.getProperty("server.port"))));
//            //log.info(AnsiOutput.toString(AnsiColor.BRIGHT_GREEN, "project server has started successfully!"));
//            StaticLog.info(StrUtil.format("项目名称[spring.application.name]:{}", env.getProperty("spring.application.name")));
//            StaticLog.info(StrUtil.format("项目请求地址:{}:{}", inetAddress.getHostAddress(), env.getProperty("server.port")));
//            StaticLog.info("project server has started successfully!");
//        };
//    }
    // regionend
}
